001 /* 002 * Copyright (c) 2005 Stephen J. McConnell 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 013 * implied. 014 * 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018 019 package net.dpml.component; 020 021 import java.io.File; 022 023 /** 024 * The ControllerContext declares the runtime context that a controller 025 * is established within. Controller implementations will typically receive 026 * be bsupplied with a context object as a constructor argument. 027 * 028 * @author <a href="http://www.dpml.net">Digital Product Meta Library</a> 029 * @version 1.0.2 030 */ 031 public interface ControllerContext 032 { 033 /** 034 * Return the assigned root partition. 035 * 036 * @return the partition name 037 */ 038 String getPartition(); 039 040 /** 041 * Return the root working directory. 042 * 043 * @return directory representing the root of the working directory hierachy 044 */ 045 File getWorkingDirectory(); 046 047 /** 048 * Return the root temporary directory. 049 * 050 * @return directory representing the root of the temporary directory hierachy. 051 */ 052 File getTempDirectory(); 053 054 /** 055 * Add the supplied controller context listener to the controller context. A 056 * controller implementation should not maintain strong references to supplied 057 * listeners. 058 * 059 * @param listener the controller context listener to add 060 */ 061 void addControllerContextListener( ControllerContextListener listener ); 062 063 /** 064 * Remove the supplied controller context listener from the controller context. 065 * 066 * @param listener the controller context listener to remove 067 */ 068 void removeControllerContextListener( ControllerContextListener listener ); 069 070 }